import Api from '../../../utils/http/api'
import common_utils from "../../../utils/common_utils";
import time_utils from "../../../utils/time_utils";


const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    order: null,
    customer: null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let params = {

      id: options.id
    }
    Api.getOrderById(params).then(res => {
      let order = res.data.order
      let customer = res.data.customer

      order.createAt = time_utils.getDateYMDHMS(order.createAt)
      order.productPicture = common_utils.getApiImg(order.productPicture)


      this.setData({
        order,
        customer
      })




    }).catch(err => console.log(err))
  },
})
